package com.shaobufan.museum.pojo.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDate;

/**
 * 博物馆展览
 * @TableName museum_exhibit
 */
@TableName(value ="museum_exhibit")
@Data
public class MuseumExhibit implements Serializable {
    /**
     * 展览id
     */
    @TableId(value = "ex_id", type = IdType.AUTO)
    private Integer exId;

    /**
     * 展览名称
     */
    @TableField(value = "ex_name")
    private String exName;

    /**
     * 展览详情
     */
    @TableField(value = "ex_detail")
    private String exDetail;

    /**
     * 展览图片
     */
    @TableField(value = "ex_image")
    private String exImage;

    /**
     * 开始时间
     */
    @TableField(value = "ex_start")
    private LocalDate exStart;

    /**
     * 结束时间
     */
    @TableField(value = "ex_end")
    private LocalDate exEnd;

    /**
     * 逻辑删除
     */
    @TableField(value = "is_delete")
    @TableLogic
    private Integer isDelete;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        MuseumExhibit other = (MuseumExhibit) that;
        return (this.getExId() == null ? other.getExId() == null : this.getExId().equals(other.getExId()))
            && (this.getExName() == null ? other.getExName() == null : this.getExName().equals(other.getExName()))
            && (this.getExDetail() == null ? other.getExDetail() == null : this.getExDetail().equals(other.getExDetail()))
            && (this.getExImage() == null ? other.getExImage() == null : this.getExImage().equals(other.getExImage()))
            && (this.getExStart() == null ? other.getExStart() == null : this.getExStart().equals(other.getExStart()))
            && (this.getExEnd() == null ? other.getExEnd() == null : this.getExEnd().equals(other.getExEnd()))
            && (this.getIsDelete() == null ? other.getIsDelete() == null : this.getIsDelete().equals(other.getIsDelete()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getExId() == null) ? 0 : getExId().hashCode());
        result = prime * result + ((getExName() == null) ? 0 : getExName().hashCode());
        result = prime * result + ((getExDetail() == null) ? 0 : getExDetail().hashCode());
        result = prime * result + ((getExImage() == null) ? 0 : getExImage().hashCode());
        result = prime * result + ((getExStart() == null) ? 0 : getExStart().hashCode());
        result = prime * result + ((getExEnd() == null) ? 0 : getExEnd().hashCode());
        result = prime * result + ((getIsDelete() == null) ? 0 : getIsDelete().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", exId=").append(exId);
        sb.append(", exName=").append(exName);
        sb.append(", exDetail=").append(exDetail);
        sb.append(", exImage=").append(exImage);
        sb.append(", exStart=").append(exStart);
        sb.append(", exEnd=").append(exEnd);
        sb.append(", isDelete=").append(isDelete);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}